package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.EmpSocBackRecordRecordAddDTO;
import org.jsola.hr.dto.EmpSocBackRecordRecordUpdateDTO;
import org.jsola.hr.dto.SocBackRecordImportDTO;
import org.jsola.hr.query.EmpSocBackRecordInfoQuery;
import org.jsola.hr.query.EmpSocBackRecordRecordQuery;
import org.jsola.hr.vo.EmpSocBackRecordRecordListVO;
import org.jsola.hr.vo.EmpSocBackRecordRecordVO;
import org.jsola.hr.vo.ImportExcelResultListVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.List;

/**
 * 社保回款记录
 *
 * @author zhr
 */
@Api(tags = "hr-社保回款记录")
public interface IEmpSocBackRecordRecordControllerAPI {

    /**
     * 新增社保回款记录
     *
     * @param empSocBackRecordRecordAddDTO 社保回款记录新增实体
     * @return 社保回款记录展示对象
     */
    @ApiOperation(value = "新增社保回款记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordAddDTO", dataType = "EmpSocBackRecordRecordAddDTO", value = "新增社保回款记录", paramType = "body")
    })
    Result<EmpSocBackRecordRecordVO> save(EmpSocBackRecordRecordAddDTO empSocBackRecordRecordAddDTO);

    /**
     * 新增社保回款记录(批量)
     *
     * @param empSocBackRecordRecords 社保回款记录新增实体
     * @return 社保回款记录展示对象
     */
    @ApiOperation(value = "新增社保回款记录(批量)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecords", dataType = "EmpSocBackRecordRecordAddDTO[]", value = "新增社保回款记录", paramType = "body", allowMultiple = true)
    })
    Result<Integer> saveBatch(EmpSocBackRecordRecordAddDTO[] empSocBackRecordRecords);


    /**
     * 修改社保回款记录
     *
     * @param empSocBackRecordRecordUpdateDTO 社保回款记录
     * @return 更新数量
     */
    @ApiOperation(value = "修改社保回款记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordUpdateDTO", dataType = "EmpSocBackRecordRecordUpdateDTO", value = "修改社保回款记录", paramType = "body")
    })
    Result<Integer> update(EmpSocBackRecordRecordUpdateDTO empSocBackRecordRecordUpdateDTO);


    /**
     * 删除单个社保回款记录，彻底删除
     *
     * @param empSocBackRecordRecordId 社保回款记录id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个社保回款记录，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordId", dataType = "String", value = "社保回款记录id", paramType = "path")
    })
    Result<Integer> delete(String empSocBackRecordRecordId);


    /**
     * 批量删除社保回款记录，彻底删除
     *
     * @param empSocBackRecordRecordIds 社保回款记录id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除社保回款记录，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordIds", dataType = "String[]", value = "社保回款记录id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] empSocBackRecordRecordIds);


    /**
     * 根据社保回款记录id查询社保回款记录详情
     *
     * @param empSocBackRecordRecordId 社保回款记录id
     * @return 社保回款记录详情
     */
    @ApiOperation(value = "根据社保回款记录id查询社保回款记录详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordId", dataType = "String", value = "社保回款记录id", paramType = "path")
    })
    Result<EmpSocBackRecordRecordVO> findById(String empSocBackRecordRecordId);


    /**
     * 查询社保回款记录
     *
     * @param empSocBackRecordRecordQuery 社保回款记录查询参数
     * @return page
     */
    @ApiOperation(value = "查询社保回款记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordQuery", dataType = "EmpSocBackRecordRecordQuery", value = "社保回款记录查询参数", paramType = "query")
    })
    Result<List<EmpSocBackRecordRecordListVO>> listAll(EmpSocBackRecordRecordQuery empSocBackRecordRecordQuery);


    /**
     * 分页查询社保回款记录
     *
     * @param empSocBackRecordRecordQuery 社保回款记录查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询社保回款记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empSocBackRecordRecordQuery", dataType = "EmpSocBackRecordRecordQuery", value = "社保回款记录查询参数", paramType = "query")
    })
    Result<Page<EmpSocBackRecordRecordListVO>> page(EmpSocBackRecordRecordQuery empSocBackRecordRecordQuery);

    /**
     * @param file  导入文件
     * @param query 查询参数
     * @return 导入结果
     */
    @ApiOperation(value = "导入excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file",
                    value = "文件，Content-Type需要设置为multipart/form-data",
                    paramType = "form"),
            @ApiImplicitParam(name = "query", dataType = "EmpSocBackRecordInfoQuery", value = "查询参数", paramType = "form")
    })
    Result<ImportExcelResultListVO<SocBackRecordImportDTO>> importRecord(MultipartFile file, EmpSocBackRecordInfoQuery query);


    /**
     * 错误数据导出
     * @param errorInfo 错误数据
     * @return Excel
     */
    @ApiOperation(value = "错误数据导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "errorInfo", dataType = "ImportExcelResultListVO", value = "错误数据", paramType = "body")
    })
    ResponseEntity<Resource> exportErrorList(@RequestBody @Valid ImportExcelResultListVO<SocBackRecordImportDTO> errorInfo);

}

